package com.yingxin.yxerp.module.inform.entity.enums;

import cn.hutool.core.util.ObjectUtil;

/**
 * 通知公告 已读未读 枚举
 */

public enum UserNoticeReadFlag {

    ZERO("0", "未读"),
    ONE("1", "已读"),
    ;

    private String flag;

    private String flagName;

    UserNoticeReadFlag(String flag, String flagName) {
        this.flag = flag;
        this.flagName = flagName;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getFlagName() {
        return flagName;
    }

    public void setFlagName(String flagName) {
        this.flagName = flagName;
    }

    public static UserNoticeReadFlag getEnum(String flag) {
        if ( ObjectUtil.isEmpty( flag ) ) {
            return null;
        }
        for (UserNoticeReadFlag i : UserNoticeReadFlag.values()) {
            if ( i.getFlag().equals( flag ) ) {
                return i;
            }
        }
        return null;
    }

}
